package com.mud.ultimate.dialogs;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.mud.ultimate.GameHandler;
import com.mud.ultimate.GameLauncherActivity;
import com.mud.ultimate.R;



public class NameChangeDialog extends Activity {

	
		

	private EditText usernameET;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.name_change_dialog);
		
		usernameET = (EditText)findViewById(R.id.userNameET);
		
		Button changeButton = (Button)findViewById(R.id.changeNameB);
		changeButton.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				
				Intent resultIntent = new Intent();
				resultIntent.putExtra(GameHandler.USERNAME_KEY, usernameET.getText().toString());
				setResult(RESULT_OK, resultIntent);
				finish();
				
			}
		});
	}
	

	
	
	
}
